<?php

namespace Biz\Requests\Site;

use Illuminate\Validation\Rule;
use Biz\Dictionaries\CurrencyDict;
use Lumen\Validation\Validators\RequestValidator;

/**
 * SiteOrderHotelReservationRequest.
 *
 * @license [http://www.85do.com] [杭州永奥网络科技有限公司]
 * @copyright Copyright (c) 2018-2026 Hangzhou Yongao Technology Co., Ltd. All rights reserved.
 */
class SiteOrderHotelReservationRequest extends RequestValidator
{
    /**
     * Get custom rules for validator errors.
     *
     * @return array
     */
    public function rules(): array
    {
        return [
            'currency'               => [
                'required',
                'string',
                'distinct',
                'max:6',
                Rule::in(CurrencyDict::keys()),
            ],
            'total_amount'                                               => 'required|numeric|min:0.01',
            'hotel_reservation'                                          => 'required',
            'hotel_reservation.hotel_name'                               => 'required|string|max:255',
            'hotel_reservation.reservation_no'                           => 'required|string|max:255',
            'hotel_reservation.room_type_name'                           => 'required|string|max:255',
            'hotel_reservation.room_price'                               => 'required|numeric|min:0',
            'hotel_reservation.room_number'                              => 'required|numeric|max:300',
            'hotel_reservation.check_in_date'                            => 'required|date',
            'hotel_reservation.check_out_date'                           => 'required|date|after:check_in_date',
            'hotel_reservation.remark'                                   => 'max:255',
        ];
    }
}
